﻿using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.PlatformAbstractions;
using Sino.CapacityCloud.Services;
using Sino.CapacityCloud.Tests.Mocks;

namespace Sino.CapacityCloud.Web
{

    public class TestStartup
        : Startup
    {

        public TestStartup(IApplicationEnvironment applicationEnvironment, IHostingEnvironment env, IRuntimeEnvironment runtimeEnvironment)
            : base(applicationEnvironment, env, runtimeEnvironment)
        {
        }

        protected override void ConfigureApplicationServices(IServiceCollection services)
        {
            base.ConfigureApplicationServices(services);

#if DEBUG
            services.AddTransient<ISmsSender, SmsSender>();
#endif
            services.AddBackgroundWorker<IFakeTmsEventBusSource, FakeTmsEventBusSource>();
        }

        public override void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            base.Configure(app, env, loggerFactory);

            //app.ApplicationServices.GetService<IFakeTmsEventBusSource>();
        }

    }

}